package dk.sdu.flexibus.domain;

import java.util.Calendar;

public class Transport {
	public static int STATE_UNDEFINED = 0;
	public static int STATE_CREATED = 1;
	public static int STATE_SENT = 2;
	public static int STATE_OFFERED = 3;
	public static int STATE_COMPLETED = 4;
	public static final int STATE_REJECTED = 5;
	public static final int STATE_CANCEL_SENT = 6;
	
	public static final int KEY_UNDEFINED = -1;
	public static final int SERVER_ID_UNDEFINED = -1;
	
	private int id = KEY_UNDEFINED;
	private int serverId = SERVER_ID_UNDEFINED;
	private int transportState = STATE_UNDEFINED;
	private Calendar pickupTime;
	private String pickupAddress;
	private Calendar dropOffTime;
	private String dropOffPlace;
	public static final String SHORT_SCREEN_DATE_FORMAT = "%1$td/%1$tm";
	public static final String FULL_SCREEN_DATE_FORMAT = SHORT_SCREEN_DATE_FORMAT+" %1$tY";
	public static final String TIME_FORMAT = "%1$tH:%1$tM";
	public static final String SHORT_COMBINED_FORMAT = SHORT_SCREEN_DATE_FORMAT+" "+TIME_FORMAT;
	
	
	

	public Transport() {
	}
	
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getServerId() {
		return serverId;
	}

	public void setServerId(int serverId) {
		this.serverId = serverId;
	}
	
	public int getTransportState() {
		return transportState;
	}

	public void setTransportState(int transportState) {
		this.transportState = transportState;
	}

	public Calendar getPickupTime() {
		return pickupTime;
	}

	public void setPickupTime(Calendar pickupTime) {
		this.pickupTime = pickupTime;
	}
	
	public String getPickupAddress() {
		return pickupAddress;
	}

	public void setPickupAddress(String pickupAddress) {
		this.pickupAddress = pickupAddress;
	}

	public Calendar getDropOffTime() {
		return dropOffTime;
	}

	public void setDropOffTime(Calendar dropOffTime) {
		this.dropOffTime = dropOffTime;
	}

	public String getDropOffPlace() {
		return dropOffPlace;
	}

	public void setDropOffPlace(String dropOffPlace) {
		this.dropOffPlace = dropOffPlace;
	}
	
	public String toString(){
		return String.format(SHORT_COMBINED_FORMAT, dropOffTime)+" - "+dropOffPlace;
	}
}
